#pragma once

#include "common.h"
#include "sleep_api.h"

typedef struct _csem_sleep {
  uint64_t ts;
  int awake_order;
  /*
  0: sleep
  1: wake
   */
  uint8_t type;
  long bed_rest_duration;
} csem_sleep_t;

#ifdef __cplusplus
extern "C" {
#endif

EXPORT void csem_calc(csem_sleep_t *csem_slps, size_t slp_len,
                      smp_hr_t *hr_list, size_t hr_len, sleep_root **root);

#ifdef __cplusplus
}
#endif